﻿namespace Contoso.ActiveDirectory {

    /// <summary>
    /// http://msdn.microsoft.com/en-us/library/cc223320.aspx
    /// LDAP extended controls are an extensibility mechanism in version 3 of LDAP, as discussed in [RFC2251] section 4.1.12.
    /// The LDAP extended controls supported by a DC are exposed as OIDs in the supportedControl attribute of the rootDSE. 
    /// Each OID corresponds to a human-readable name.
    /// </summary>
    public static class LdapExtendedControls {

        /// <summary>
        /// Splits the results of an LDAP search across multiple result sets.
        /// </summary>
        public const string LDAP_PAGED_RESULT_OID_STRING = "1.2.840.113556.1.4.319";

        /// <summary>
        /// Used with an LDAP Modify DN operation to move an object from one domain to another domain.
        /// </summary>
        public const string LDAP_SERVER_CROSSDOM_MOVE_TARGET_OID = "1.2.840.113556.1.4.521";

        /// <summary>
        /// Used with an LDAP search operation to retrieve the changes made to objects since a previous LDAP_SERVER_DIRSYNC_OID search was performed.
        /// </summary>
        public const string LDAP_SERVER_DIRSYNC_OID = "1.2.840.113556.1.4.841";

        /// <summary>
        /// Instructs the DC not to generate LDAP continuation references in response to a search operation.
        /// </summary>
        public const string LDAP_SERVER_DOMAIN_SCOPE_OID = "1.2.840.113556.1.4.1339";

        /// <summary>
        /// Used to request than an LDAP search operation return DNs in an extended format containing the values of the objectGUID and objectSid attributes.
        /// </summary>
        public const string LDAP_SERVER_EXTENDED_DN_OID = "1.2.840.113556.1.4.529";

        /// <summary>
        /// Used with an LDAP search request to instruct the DC to return statistical data related to how the search was performed.
        /// </summary>
        public const string LDAP_SERVER_GET_STATS_OID = "1.2.840.113556.1.4.970";

        /// <summary>
        /// Instructs the DC that it MAY sacrifice durability guarantees on updates to improve performance.
        /// </summary>
        public const string LDAP_SERVER_LAZY_COMMIT_OID = "1.2.840.113556.1.4.619";

        /// <summary>
        /// Instructs the DC that an LDAP modify should succeed even if it attempts to add a value already present on the attribute 
        /// or remove a value not present on the attribute.
        /// </summary>
        public const string LDAP_SERVER_PERMISSIVE_MODIFY_OID = "1.2.840.113556.1.4.1413";

        /// <summary>
        /// Used with an LDAP search operation to register the client to be notified when changes are made to an object in the directory.
        /// </summary>
        public const string LDAP_SERVER_NOTIFICATION_OID = "1.2.840.113556.1.4.528";

        /// <summary>
        /// Response control for instructing the DC to sort the search results.
        /// </summary>
        public const string LDAP_SERVER_RESP_SORT_OID = "1.2.840.113556.1.4.474";

        /// <summary>
        /// Instructs the DC which portions of a Windows security descriptor to retrieve during an LDAP search operation.
        /// </summary>
        public const string LDAP_SERVER_SD_FLAGS_OID = "1.2.840.113556.1.4.801";

        /// <summary>
        /// Used to pass flags to the DC to control search behaviors; specifically, to prevent LDAP continuation references 
        /// from being generated and to search all NC replicas that are subordinate to the search base, even if the search base 
        /// is not instantiated on the DC.
        /// </summary>
        public const string LDAP_SERVER_SEARCH_OPTIONS_OID = "1.2.840.113556.1.4.1340";

        /// <summary>
        /// Request control for instructing the DC to sort the search results.
        /// </summary>
        public const string LDAP_SERVER_SORT_OID = "1.2.840.113556.1.4.473";

        /// <summary>
        /// Used with an LDAP operation to specify that tombstones and deleted-objects are visible to the operation.
        /// </summary>
        public const string LDAP_SERVER_SHOW_DELETED_OID = "1.2.840.113556.1.4.417";

        /// <summary>
        /// Used with an LDAP delete operation to cause the server to recursively delete the entire subtree of objects 
        /// located under the object specified in the search request (including the specified object).
        /// </summary>
        public const string LDAP_SERVER_TREE_DELETE_OID = "1.2.840.113556.1.4.805";

        /// <summary>
        /// Permits the client to specify which GC the DC should use when processing an add or modify request to verify 
        /// the existence of any objects pointed to by DN attribute values.
        /// </summary>
        public const string LDAP_SERVER_VERIFY_NAME_OID = "1.2.840.113556.1.4.1338";

        /// <summary>
        /// Request control used with an LDAP search operation to retrieve a "sliding window" subset of the objects that satisfy the search request.
        /// </summary>
        public const string LDAP_CONTROL_VLVREQUEST = "2.16.840.1.113730.3.4.9";

        /// <summary>
        /// Response control used with an LDAP search operation to retrieve a "sliding window" subset of the objects that satisfy the search request.
        /// </summary>
        public const string LDAP_CONTROL_VLVRESPONSE = "2.16.840.1.113730.3.4.10";

        /// <summary>
        /// Used to specify that an LDAP search operation should not be performed against the object specified as the base in the search, 
        /// but rather against the set of objects named by a specified attribute of Object(DS-DN) syntax on the base object.
        /// </summary>
        public const string LDAP_SERVER_ASQ_OID = "1.2.840.113556.1.4.1504";

        /// <summary>
        /// Used with an LDAP search operation to retrieve the quota of a user.
        /// </summary>
        public const string LDAP_SERVER_QUOTA_CONTROL_OID = "1.2.840.113556.1.4.1852";

        /// <summary>
        /// Indicates that the server is capable of range retrieval
        /// </summary>
        public const string LDAP_SERVER_RANGE_OPTION_OID = "1.2.840.113556.1.4.802";

        /// <summary>
        /// Used with an LDAP search operation to cause the client to be notified when the DC is shutting down.
        /// </summary>
        public const string LDAP_SERVER_SHUTDOWN_NOTIFY_OID = "1.2.840.113556.1.4.1907";

        /// <summary>
        /// When attached to an LDAP update operation, causes the DC to perform the update even if that update would not affect the state of the DC.
        /// </summary>
        public const string LDAP_SERVER_FORCE_UPDATE_OID = "1.2.840.113556.1.4.1974";

        /// <summary>
        /// Instructs the DC that, when performing a search using range retrieval on an attribute whose values are forward link values 
        /// or back link values and the value of low is greater than or equal to the number of values in the attribute, 
        /// no error should be returned.
        /// </summary>
        public const string LDAP_SERVER_RANGE_RETRIEVAL_NOERR_OID = "1.2.840.113556.1.4.1948";

        /// <summary>
        /// This control is used as part of the process of promoting a computer to be an RODC.
        /// </summary>
        public const string LDAP_SERVER_RODC_DCPROMO_OID = "1.2.840.113556.1.4.1341";

        /// <summary>
        /// This control is used to specify the DN of an object during an LDAP operation. 
        /// Currently this control is used only while retrieving the constructed attribute msDS-IsUserCachableAtRodc 
        /// </summary>
        public const string LDAP_SERVER_DN_INPUT_OID = "1.2.840.113556.1.4.2026";

        /// <summary>
        /// Used with an LDAP search operation to specify that link attributes that refer to deleted-objects are visible to the search operation. 
        /// If used in conjunction with LDAP_SERVER_SHOW_DELETED_OID or LDAP_SERVER_SHOW_RECYCLED_OID, link attributes that are stored 
        /// on deleted-objects are also visible to the search operation. 
        /// This applies both to the search filter and the set of attributes returned by the search operation.
        /// </summary>
        public const string LDAP_SERVER_SHOW_DEACTIVATED_LINK_OID = "1.2.840.113556.1.4.2065";

        /// <summary>
        /// Used with an LDAP operation to specify that tombstones, deleted-objects, and recycled-objects are visible to the operation.
        /// </summary>
        public const string LDAP_SERVER_SHOW_RECYCLED_OID = "1.2.840.113556.1.4.2064";

        /// <summary>
        /// The LDAP_SERVER_POLICY_HINTS_DEPRECATED_OID control has the exact semantics and behaviors as LDAP_SERVER_POLICY_HINTS_OID 
        /// this control MAY be used by clients when the server does not support LDAP_SERVER_POLICY_HINTS_OID. 
        /// Clients SHOULD use LDAP_SERVER_POLICY_HINTS_OID when it is supported by the server.
        /// </summary>
        public const string LDAP_SERVER_POLICY_HINTS_DEPRECATED_OID = "1.2.840.113556.1.4.2066";

        /// <summary>
        /// Used with an LDAP search operation to retrieve the changes made to objects since a previous LDAP_SERVER_DIRSYNC_EX_OID search was performed.
        /// </summary>
        public const string LDAP_SERVER_DIRSYNC_EX_OID = "1.2.840.113556.1.4.2090";

        /// <summary>
        /// The LDAP_SERVER_UPDATE_STATS_OID control indicates that the requester requires statistics from the DC.
        /// </summary>
        public const string LDAP_SERVER_UPDATE_STATS_OID = "1.2.840.113556.1.4.2205";

        /// <summary>
        /// Used with an LDAP delete operation to cause the server to recursively delete the entire subtree of objects, up to a specified number of objects, located under the object specified in the search request (including the specified object).
        /// </summary>
        public const string LDAP_SERVER_TREE_DELETE_EX_OID = "1.2.840.113556.1.4.2204";

        /// <summary>
        /// Provides hints to the DC during LDAP search operations.
        /// </summary>
        public const string LDAP_SERVER_SEARCH_HINTS_OID = "1.2.840.113556.1.4.2206";

        /// <summary>
        /// Monitors the result of an LDAP search operation and potentially modifies the return code.
        /// </summary>
        public const string LDAP_SERVER_EXPECTED_ENTRY_COUNT_OID = "1.2.840.113556.1.4.2211";

        /// <summary>
        /// Used with an LDAP operation to enforce password history policies during password set.
        /// </summary>
        public const string LDAP_SERVER_POLICY_HINTS_OID = "1.2.840.113556.1.4.2239";

        /// <summary>
        /// Used with an LDAP add operation to set the owner of the object to a SID other than that of the requester.
        /// </summary>
        public const string LDAP_SERVER_SET_OWNER_OID = "1.2.840.113556.1.4.2255";

        /// <summary>
        /// Used with an LDAP add operation to specify that quota limits do not apply for the add operation.
        /// </summary>
        public const string LDAP_SERVER_BYPASS_QUOTA_OID = "1.2.840.113556.1.4.2256";

    }
}
